package day09;
//线程提供了静态方法Thread currentThread方法；用于获取调用该方法的线程

public class Thread_currentThread {

	public static void main(String[] args) {

		Thread t = Thread.currentThread();
		System.out.println("调用main的线程是："+t);
		System.out.println(t.getId());

		Thread t1 = new Thread() {
			public void run() {
				dosome();
			}
		};
		
		t1.start();
		dosome();
		

	}

	public static void dosome() {
		Thread t = Thread.currentThread();
		System.out.println("调用dosome方法的线程是：" + t);
		long l=t.getId();
		System.out.println(l);

	}

}
